package jee.boot.common.service;

import jee.boot.common.basic.TreeService;
import jee.boot.common.cache.CacheDataManager;
import jee.boot.common.dao.AreaDao;
import jee.boot.entity.system.Area;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 行政区划Service
 * 
 * @author zhilei.wang
 * @version 2018-09-28
 */
@Service
public class AreaService extends TreeService<AreaDao, Area> {
    /**
     * 初始化主数据的缓存进入redis中
     *
     * @param entity
     */
    @Cacheable(value = CacheDataManager.SYSTEM_CACHE_NAME, key = "#entity.cacheKey")
    public List<Area> initCache(Area entity) {
        return findList(entity);
    }
}